package org.xiaoai.thread;

public class Main {

	public static void main(String[] args) {
		
		MyThread myJob1 = new MyThread();  
		MyThread myJob2 = new MyThread();  
		
		Thread t1 = new Thread(myJob1,"A");
		Thread t2 = new Thread(myJob2,"B");
		t2.start();  
		t1.start();  
		
       
		
		try {
			
			t1.join(2000);
			
			 System.out.println("...........");
			
			t2.join(1000);
			
			
			
			 System.out.println("main run......");
			//Thread.sleep(10);
		//	myThread1.setFlag(false);
			//myThread2.setFlag(false);
			
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
      /*
		try {
			//myThread1.sleep(200);
			myThread1.setFlag(false);
			//myThread2.sleep(100);
			myThread2.setFlag(false);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		*/
		
	
	}
	
	
}
